import request from "@/utils/request";

export function getBannerList() {
  return request.get("/banner/list");
}


export function getCategoryList() {
  return request.get("/pro/categorylist");
}


export function getShopList(count, limitNum) {
  return request.get("/pro/list", {
    params: {
      count,
      limitNum,
    },
  });
}


export function getKillList(count, limitNum) {
  return request.get("/pro/seckilllist", {
    params: {
      count,
      limitNum,
    },
  });
}

export function login(body) {
  return request.post("/user/login", body);
}


export function sendSMS(body) {
  return request.post("/user/dosendmsgcode");
}


export function checkCode(body) {
  return request.post("/user/docheckcode", body);
}

export function getRecommendList(count, limitNum) {
  return request.get("/pro/recommendlist", {
    params: {
      count,
      limitNum,
    },
  });
}


export function register(body) {
  return request.post("/user/dofinishregister", body);
}


export function getProductById(proid) {
  return request.get(`/pro/detail/${proid}`, {
    params: [proid],
  });
}


export function joinCart(body) {
  return request.post("/cart/add", body);
}


export function getCarList(body) {
  return request.post("/cart/list", body);
}


export function updateNum(body) {
  return request.post("/cart/updatenum", body);
}


export function selectOne(body) {
  return request.post("/cart/selectone", body);
}


export function removeCartItem(body) {
  return request.post("/cart/remove", body);
}


export function removeAll(body) {
  return request.post("/cart/removeall", body)
}


export function selectAll(body) {
  return request.post("/cart/selectall", body)
}
